load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "idxrecommendations",
    srcs = [
        "idx_recommendations.go",
        "idx_recommendations_cache.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/idxrecommendations",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/settings/cluster",
        "//pkg/sql/opt/indexrec",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sqlstats",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
    ],
)

go_test(
    name = "idxrecommendations_test",
    srcs = [
        "idx_recommendations_cache_test.go",
        "idx_recommendations_test.go",
        "main_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":idxrecommendations"],
    exec_properties = select({
        "//build/toolchains:is_heavy": {"test.Pool": "heavy"},
        "//conditions:default": {"test.Pool": "default"},
    }),
    deps = [
        "//pkg/base",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/settings/cluster",
        "//pkg/sql/opt/indexrec",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sqlstats",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_stretchr_testify//require",
    ],
)
